﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using IKEA.FileExchange.Web;
using IKEA.FileExchange.Domain.FilePackage;
using System.Collections.Generic;

public partial class controls_UploadSuccessReportControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
        Guid packageUniqueId = new Guid(Request.QueryString["p"]);

        FilePackageInformation package = FilePackageInformationProvider.GetByUniqueId(packageUniqueId);

        ltrlMngmtEmail.Text = package.SendManagementLinkToEmail;
        
        span1.Visible = !string.IsNullOrEmpty(package.SendManagementLinkToEmail);
        hlManagementInterface.Text = UrlHelper.GeneratePackageManagementUrl(Request.QueryString["p"]);
        hlManagementInterface.NavigateUrl = hlManagementInterface.Text;

        List<string> recipientsList = package.GetRecipients();

        if (recipientsList.Count > 0)
        {
            repRecipientsLists.DataSource = package.GetRecipients();
            repRecipientsLists.DataBind();
        }
        else
        {
            divRecipientsList.Visible = false;
        }

        if (package.IsConfidential)
        {
            ltrlUploadStoreName.Text = "the confidential files store";
        }
        else
        {
            ltrlUploadStoreName.Text = "the public file store and available on <a href='Default.aspx'>ikeafiles.ru</a>";
        }

       

    }

    protected void btnOK_Click(object sender, EventArgs e)
    {
        Response.Redirect(Request.QueryString["source"]);
    }
}
